package com.ssy.lingxi.contract.model.constant;

import java.util.Arrays;

/**
 *  合同订单变更类型.
 * @author ds
 * @version 2.0.0
 * @date 2021/4/15 16:35
 */
public enum ContractOrderChangeTypeEnum {

    ADD(1, "新增"),
    CANCEL(2, "取消"),
    ;

    private final Integer code;
    private final String message;

    ContractOrderChangeTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(ContractOrderChangeTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(ADD).getMessage();
    }
}
